<?php
$form = @$_REQUEST['formtype'];

if($form == 'multi-keyword' || $show_all == 'show') {

if (empty($temp_keywords)) $temp_keywords = array();
if (empty($temp_pageurls)) $temp_pageurls = '';

?>
<form action="rank-checker.php" method="post" name="multiplekey" id="multiplekey">
<table width="98%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="center"><table width="550" border="0" cellspacing="0" cellpadding="0"  class="mytable">
      <tr>
        <td><strong>Multi Keyword Rank Checker Tool</strong> </td>
      </tr>
      <tr>
        <td><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center"><table width="98%" border="0" cellspacing="2" cellpadding="2">
					<tbody id="tbody1">
                    <tr>
                      <td colspan="2" align="left"><strong>Keywords</strong></td>
                    </tr>
					<?php
					$num_urls = 0; 
					foreach ($temp_keywords as $keyword )
					{
						if(empty($keyword)) continue;
					?>
					<tr>
                      <td width="5%" align="left">#<?php echo ++$num_urls; ?></td>
                      <td width="95%" align="left"><input name="keywords[]" id="keywords" value="<?php echo $keyword; ?>" type="text" class="input" size="40" /></td>
                    </tr>
					<?php
					}
					if ($num_urls < 2)
					{
					?>
                    <tr>
                      <td width="5%" align="left">#<?php echo ++$num_urls; ?></td>
                      <td width="95%" align="left"><input name="keywords[]" id="keywords" type="text" class="input" size="40" /></td>
                    </tr>
                    <tr>
                      <td align="left">#<?php echo ++$num_urls; ?></td>
                      <td align="left"><input name="keywords[]" id="keywords" type="text" class="input" size="40" /></td>
                    </tr>
					<?php
					}
					echo "<script>var num_keys = $num_urls; </script>";
					?>
					</tbody>
                </table></td>
              </tr>
			  <tr>
                <td align="center" height="25" valign="middle"><a href="javascript: add_keyword();" class="link1">[+]Add Keyword</a></td>
              </tr>
              <tr>
                <td align="center"><table width="98%" border="0" cellspacing="1" cellpadding="1">
                    <tr>
                      <td width="16%">Website:</td>
                      <td width="84%" align="left"><input name="pageurls" value="<?php echo $temp_pageurls; ?>" class="input" size="34" type="text" /></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="center">&nbsp;</td>
              </tr>
              <tr>
                <td align="left">For faster results, You may limit your search to the
                  <select name="num">
				  <?php
				  foreach ($limit as $number ) {
					  if ($number == $num) {
						  echo '<option value="'.$number.'" selected>Top '.$number.'</option>';
					  } else {
						  echo '<option value="'.$number.'">Top '.$number.'</option>';
					  }
				  }
				  ?>
                  </select></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center"><input name="submit" class="button" type="submit" value="Check Rank" /><INPUT TYPE="hidden" name="formtype" value="multi-keyword"></td>
              </tr>
			  <tr>
                <td align="left" class="bodytext"><INPUT TYPE="checkbox" value="y" NAME="do_msn" <?php if (isset($_REQUEST['do_msn'])) echo "Checked"; ?>>MSN &nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="do_yahoo" value="y" <?php if (isset($_REQUEST['do_yahoo'])) echo "Checked"; ?>>Yahoo! &nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="do_google" value="y" <?php if (isset($_REQUEST['do_google'])) echo "Checked"; ?>>Google</td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td>The process may take up to 15 seconds per keyword </td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
<p>&nbsp;</p>
<?php
}
if($form == 'multi-website' || $show_all == 'show') {

if (empty($temp_keywords)) $temp_keywords ='' ;
if (empty($temp_pageurls)) $temp_pageurls = array();
?>
<form action="rank-checker.php" method="post" name="multiplekey" id="multiplekey">
<table width="98%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="center"><table width="550" border="0" cellspacing="0" cellpadding="0"  class="mytable">
      <tr>
        <td><strong>Mass Domains Rank Checker Tool</strong> </td>
      </tr>
      <tr>
        <td><table width="98%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center"><table width="98%" border="0" cellspacing="2" cellpadding="2">
					<tbody id="tbody2">
                    <tr>
                      <td colspan="2" align="left"><strong>Websites</strong></td>
                    </tr>
					<?php
					$num_urls = 0;
					foreach ($temp_pageurls as $pageurl )
					{
						if(empty($pageurl)) continue;
					?>
					<tr>
                      <td width="5%" align="left">#<?php echo ++$num_urls; ?></td>
                      <td width="95%" align="left"><input name="pageurls[]" value="<?php echo $pageurl; ?>" type="text" class="input" size="40" /></td>
                    </tr>
					<?php
					}
					if ($num_urls < 2)
					{
					?>
                    <tr>
                      <td width="5%" align="left">#<?php echo ++$num_urls; ?></td>
                      <td width="95%" align="left"><input name="pageurls[]" type="text" class="input" size="40" /></td>
                    </tr>
                    <tr>
                      <td align="left">#<?php echo ++$num_urls; ?></td>
                      <td align="left"><input name="pageurls[]" type="text" class="input" size="40" /></td>
                    </tr>
					<?php
					}
					echo "<script>var num_urls = $num_urls; </script>";
					?>
					</tbody>
                </table></td>
              </tr>
			  <tr>
                <td align="center" height="25" valign="middle"><a href="javascript: add_website();" class="link1">[+]Add Web Site</a></td>
              </tr>
              <tr>
                <td align="center"><table width="98%" border="0" cellspacing="1" cellpadding="1">
                    <tr>
                      <td width="16%">Keyword:</td>
                      <td width="84%" align="left"><input name="keywords" value="<?php echo $temp_keywords; ?>" class="input" size="34" type="text" /></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="center">&nbsp;</td>
              </tr>
              <tr>
                <td align="left">For faster results, You may limit your search to the
                  <select name="num">
				  <?php
				  foreach ($limit as $number ) {
					  if ($number == $num) {
						  echo '<option value="'.$number.'" selected>Top '.$number.'</option>';
					  } else {
						  echo '<option value="'.$number.'">Top '.$number.'</option>';
					  }
				  }
				  ?>
                  </select></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center"><input name="submit" class="button" type="submit" value="Check Rank" /><INPUT TYPE="hidden" name="formtype" value="multi-website"></td>
              </tr>
			  <tr>
                <td align="left" class="bodytext"><INPUT TYPE="checkbox" value="y" NAME="do_msn" <?php if (isset($_REQUEST['do_msn'])) echo "Checked"; ?>>MSN &nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="do_yahoo" value="y" <?php if (isset($_REQUEST['do_yahoo'])) echo "Checked"; ?>>Yahoo! &nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="do_google" value="y" <?php if (isset($_REQUEST['do_google'])) echo "Checked"; ?>>Google</td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td>The process may take up to 15 seconds per keyword </td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
<p>&nbsp;</p>
<?php
}
?>